package com.trex.modules.tbl.entity;

import javax.validation.constraints.Size;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.sys.entity.User;

/**
 * 列检作业记录Entity
 * @author jy
 * @version 2022-08-29
 */
@Table(name="tbl_xd_ljzyjl", alias="a", label="列检作业记录信息", extWhereKeys="extWhere", columns={
		@Column(name="rec_id", attrName="recId", label="列检记录编号", isPK=true),
		@Column(name="type_code", attrName="typeCode", label="0 列检 1动检", isQuery=false),
		@Column(name="work_log_id", attrName="workLogId", label="列检工作日志编号", isQuery=false),
		@Column(name="status", attrName="status", label="0未确认 1确认 2 取消 3结束", isUpdate=false, isQuery=false),
		@Column(name="line_code", attrName="lineCode", label="线路编号", isQuery=false),
		@Column(name="line", attrName="line", label="线路", isQuery=false),
		@Column(name="wagon_num", attrName="wagonNum", label="车数", isQuery=false, isUpdateForce=true),
		@Column(name="shift", attrName="shift", label="白班夜班"),
		@Column(name="team", attrName="team", label="甲乙丙丁", isQuery=false),
		@Column(name="station_usercode", attrName="stationUsercode", label="车站发起人", isQuery=false),
		@Column(name="station_username", attrName="stationUsername", label="车站发起人", isQuery=false),
		@Column(name="station_time", attrName="stationTime", label="车站发起时间", isUpdateForce=true),
		@Column(name="confirm_usercode", attrName="confirmUsercode", label="确认人", isQuery=false),
		@Column(name="confirm_username", attrName="confirmUsername", label="确认人", isQuery=false),
		@Column(name="confirm_time", attrName="confirmTime", label="确认时间", isQuery=false, isUpdateForce=true),
		@Column(name="cancel_usercode", attrName="cancelUsercode", label="取消人", isQuery=false),
		@Column(name="cancel_username", attrName="cancelUsername", label="取消人", isQuery=false),
		@Column(name="cancel_time", attrName="cancelTime", label="取消时间", isQuery=false, isUpdateForce=true),
		@Column(name="finish_usercode", attrName="finishUsercode", label="结束人", isQuery=false),
		@Column(name="finish_username", attrName="finishUsername", label="结束人", isQuery=false),
		@Column(name="finish_time", attrName="finishTime", label="结束时间", isQuery=false, isUpdateForce=true),
		@Column(name="password", attrName="password", label="口令", isQuery=false),
		@Column(name="jcr_code", attrName="jcrCode", label="检车人", isQuery=false),
		@Column(name="jcr_name", attrName="jcrName", label="检车人", isQuery=false),
		@Column(name="dele_flag", attrName="deleFlag", label="删除标志位", isQuery=false),
		@Column(name="user_code", attrName="userCode", label="更新人", isQuery=false),
		@Column(name="user_name", attrName="userName", label="更新人", isQuery=false),
		@Column(name="upd_time", attrName="updTime", label="更新时间", isQuery=false, isUpdateForce=true),
		@Column(name="ip", attrName="ip", label="IP地址", isQuery=false),
	}, joinTable={
			@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="user", alias="c",
					on="c.user_code = a.user_code", columns={@Column(includeEntity=User.class)}
				),
				@JoinTable(type=Type.LEFT_JOIN, entity=TblZdLjzyqdz.class, attrName="contrast", alias="b",
					on="SUBSTRING(a.LINE_CODE,1,4) = b.AREA_CODE", columns={
							@Column(name="dele_flag", attrName="deleFlag2", label="删除标志位"),
							@Column(name="roleid", attrName="roleId", label="角色ID"),
							
				}),
			}, orderBy="a.rec_id DESC"
)
public class TblXdLjzyjl extends DataEntity<TblXdLjzyjl> {
	
	private static final long serialVersionUID = 1L;
	private String recId;		// 列检记录编号
	private String typeCode;		// 0 列检 1动检
	private String workLogId;		// 列检工作日志编号
	private String lineCode;		// 线路编号
	private String line;		// 线路
	private Integer wagonNum;		// 车数
	private String shift;		// 白班夜班
	private String team;		// 甲乙丙丁
	private String stationUsercode;		// 车站发起人
	private String stationUsername;		// 车站发起人
	private Date stationTime;		// 车站发起时间
	private String confirmUsercode;		// 确认人
	private String confirmUsername;		// 确认人
	private Date confirmTime;		// 确认时间
	private String cancelUsercode;		// 取消人
	private String cancelUsername;		// 取消人
	private Date cancelTime;		// 取消时间
	private String finishUsercode;		// 结束人
	private String finishUsername;		// 结束人
	private Date finishTime;		// 结束时间
	private String password;		// 口令
	private String jcrCode;		// 检车人
	private String jcrName;		// 检车人
	private String deleFlag;		// 删除标志位
	private String userCode;		// 更新人
	private String userName;		// 更新人
	private Date updTime;		// 更新时间
	private String ip;		// IP地址
	private User user; //用户信息
	private String deleFlag2; //删除标志位
	private String roleId; //角色ID
	private String userid;
	private String postid;
	private String stationCode;
	private String stationName;
	private Date startTime;
	private Date endTime;


	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getStationCode() {
		return stationCode;
	}

	public void setStationCode(String stationCode) {
		this.stationCode = stationCode;
	}

	public String getStationName() {
		return stationName;
	}

	public void setStationName(String stationName) {
		this.stationName = stationName;
	}

	public TblXdLjzyjl() {
		this(null);
	}
	
	public TblXdLjzyjl(String id){
		super(id);
	}
	
	public String getRecId() {
		return recId;
	}

	public void setRecId(String recId) {
		this.recId = recId;
	}
	
	@Size(min=0, max=1, message="0 列检 1动检长度不能超过 1 个字符")
	public String getTypeCode() {
		return typeCode;
	}

	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}
	
	@Size(min=0, max=20, message="列检工作日志编号长度不能超过 20 个字符")
	public String getWorkLogId() {
		return workLogId;
	}

	public void setWorkLogId(String workLogId) {
		this.workLogId = workLogId;
	}
	
	@Size(min=0, max=10, message="线路编号长度不能超过 10 个字符")
	public String getLineCode() {
		return lineCode;
	}

	public void setLineCode(String lineCode) {
		this.lineCode = lineCode;
	}
	
	@Size(min=0, max=20, message="线路长度不能超过 20 个字符")
	public String getLine() {
		return line;
	}

	public void setLine(String line) {
		this.line = line;
	}
	
	public Integer getWagonNum() {
		return wagonNum;
	}

	public void setWagonNum(Integer wagonNum) {
		this.wagonNum = wagonNum;
	}
	
	@Size(min=0, max=4, message="白班夜班长度不能超过 4 个字符")
	public String getShift() {
		return shift;
	}

	public void setShift(String shift) {
		this.shift = shift;
	}
	
	@Size(min=0, max=2, message="甲乙丙丁长度不能超过 2 个字符")
	public String getTeam() {
		return team;
	}

	public void setTeam(String team) {
		this.team = team;
	}
	
	@Size(min=0, max=10, message="车站发起人长度不能超过 10 个字符")
	public String getStationUsercode() {
		return stationUsercode;
	}

	public void setStationUsercode(String stationUsercode) {
		this.stationUsercode = stationUsercode;
	}
	
	@Size(min=0, max=20, message="车站发起人长度不能超过 20 个字符")
	public String getStationUsername() {
		return stationUsername;
	}

	public void setStationUsername(String stationUsername) {
		this.stationUsername = stationUsername;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getStationTime() {
		return stationTime;
	}

	public void setStationTime(Date stationTime) {
		this.stationTime = stationTime;
	}
	
	@Size(min=0, max=10, message="确认人长度不能超过 10 个字符")
	public String getConfirmUsercode() {
		return confirmUsercode;
	}

	public void setConfirmUsercode(String confirmUsercode) {
		this.confirmUsercode = confirmUsercode;
	}
	
	@Size(min=0, max=20, message="确认人长度不能超过 20 个字符")
	public String getConfirmUsername() {
		return confirmUsername;
	}

	public void setConfirmUsername(String confirmUsername) {
		this.confirmUsername = confirmUsername;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getConfirmTime() {
		return confirmTime;
	}

	public void setConfirmTime(Date confirmTime) {
		this.confirmTime = confirmTime;
	}
	
	@Size(min=0, max=10, message="取消人长度不能超过 10 个字符")
	public String getCancelUsercode() {
		return cancelUsercode;
	}

	public void setCancelUsercode(String cancelUsercode) {
		this.cancelUsercode = cancelUsercode;
	}
	
	@Size(min=0, max=20, message="取消人长度不能超过 20 个字符")
	public String getCancelUsername() {
		return cancelUsername;
	}

	public void setCancelUsername(String cancelUsername) {
		this.cancelUsername = cancelUsername;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCancelTime() {
		return cancelTime;
	}

	public void setCancelTime(Date cancelTime) {
		this.cancelTime = cancelTime;
	}
	
	@Size(min=0, max=10, message="结束人长度不能超过 10 个字符")
	public String getFinishUsercode() {
		return finishUsercode;
	}

	public void setFinishUsercode(String finishUsercode) {
		this.finishUsercode = finishUsercode;
	}
	
	@Size(min=0, max=20, message="结束人长度不能超过 20 个字符")
	public String getFinishUsername() {
		return finishUsername;
	}

	public void setFinishUsername(String finishUsername) {
		this.finishUsername = finishUsername;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getFinishTime() {
		return finishTime;
	}

	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}
	
	@Size(min=0, max=50, message="口令长度不能超过 50 个字符")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
//	@Size(min=0, max=10, message="检车人长度不能超过 10 个字符")
	public String getJcrCode() {
		return jcrCode;
	}

	public void setJcrCode(String jcrCode) {
		this.jcrCode = jcrCode;
	}
	
	@Size(min=0, max=20, message="检车人长度不能超过 20 个字符")
	public String getJcrName() {
		return jcrName;
	}

	public void setJcrName(String jcrName) {
		this.jcrName = jcrName;
	}
	
	@Size(min=0, max=1, message="删除标志位长度不能超过 1 个字符")
	public String getDeleFlag() {
		return deleFlag;
	}

	public void setDeleFlag(String deleFlag) {
		this.deleFlag = deleFlag;
	}
	
	@Size(min=0, max=10, message="更新人长度不能超过 10 个字符")
	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	
	@Size(min=0, max=20, message="更新人长度不能超过 20 个字符")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getUpdTime() {
		return updTime;
	}

	public void setUpdTime(Date updTime) {
		this.updTime = updTime;
	}
	
	@Size(min=0, max=15, message="IP地址长度不能超过 15 个字符")
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getDeleFlag2() {
		return deleFlag2;
	}

	public void setDeleFlag2(String deleFlag2) {
		this.deleFlag2 = deleFlag2;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	
	// 大于等于 <=
	public Date getStationTime_gte(){
		return sqlMap.getWhere().getValue("station_time", QueryType.GTE);
	}

	public void setStationTime_gte(Date stationTime){
		sqlMap.getWhere().and("station_time", QueryType.GTE, stationTime);
	}

	// 小于等于 <=
	public Date getStationTime_lte(){
		return sqlMap.getWhere().getValue("station_time", QueryType.LTE);
	}

	public void setStationTime_lte(Date stationTime){
		sqlMap.getWhere().and("station_time", QueryType.LTE, stationTime);
	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getPostid() {
		return postid;
	}

	public void setPostid(String postid) {
		this.postid = postid;
	}
}